<!DOCTYPE html>
<html class="${bg!}">

@/**
@ * 本页面所用的模板变量
@ *
@ * title : 页面的标题
@ * layoutContent : 主页面的html内容
@ * js : 业务所需要的js，为数组
@ * css : 业务所需要的css，为数组
@ * bg : 背景颜色
@ * plugins : 需要用到的插件，目前有["ztree"]
@ **/

<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>${title!"管理系统"}</title>
    <link rel="stylesheet" href="${ctxPath}/assets/common/layui/css/layui.css"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css" media="all"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/gallery/css/sample-gallery.css" media="all"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/gallery/css/ssg.css" type="text/css" media="all">

    <style>
        .layui-layer-content {
            position: relative;
            overflow: visible !important;
        }
        #container{
            width: 100%;
            height: 400px;
        }
        /*
.tip {
   position: absolute;
   bottom: 30px;
   right: 10px;
   background-color: #FFF;
   text-align: center;
   border: 1px solid #ccc;
   line-height: 30px;
   border-radius: 3px;
   padding: 0 5px;
   font-size: 12px;
}
*/
        #tip {
            background-color: #fff;
            padding-left: 10px;
            padding-right: 10px;
            position: absolute;
            font-size: 12px;
            right: 10px;
            top: 20px;
            border-radius: 3px;
            border: 1px solid #ccc;
            line-height: 30px;
        }

        /*
        #tip input[type='button'] {
            margin-top: 10px;
            margin-bottom: 10px;
            background-color: #0D9BF2;
            height: 30px;
            text-align: center;
            line-height: 30px;
            color: #fff;
            font-size: 12px;
            border-radius: 3px;
            outline: none;
            border: 0;
        }
        */

    </style>
    <!--其他插件css-->
    @if(isNotEmpty(plugins)){
    @if(array.contain(plugins,"ztree")){
    <link href="${ctxPath}/assets/common/plugins/ztree/zTreeStyle.css" rel="stylesheet" type="text/css"/>
    @}
    @}

    @/* 其他业务用的css */
    @if(isNotEmpty(css)){
    @for(item in css){
    @if(strutil.startWith(item,"/")){
    @item = ctxPath + item;
    @}
    <link href="${item}" rel="stylesheet" type="text/css"/>
    @}
    @}
</head>

<body>

@/* 页面加载loading */
@ include("/common/loading.html"){}

@/* 正文 */
${layoutContent}

@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "",
        addCtx: function (ctx) {
            if (this.ctxPath === "") {
                this.ctxPath = ctx;
            }
        }
    };
    Feng.addCtx("${ctxPath}");

    var Katrina = {
        MAX_NUMBER: 100,
        IMAGE_PATH:"https://ahmbjy.com/images/",
        getStatus: function (status) {
            if (status === 0) {
                return "创建";
            } else if (status === 1) {
                return "执行中";
            } else {
                return "已完成";
            }
        },
        formatDateTime: function (date) {
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            m = m < 10 ? ('0' + m) : m;
            var d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            var h = date.getHours();
            var minute = date.getMinutes();
            minute = minute < 10 ? ('0' + minute) : minute;
            return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
        },
        getPayType: function (type) {
            switch (type) {
                case "AP":
                    return "预付款";
                case "DIRECT":
                    return "直接付款";
                case "":
                    return "未付款";
                default:
                    return "状态异常";
            }
        },

        isEmpty:function (val) {
            if(typeof(val) === "undefined" || val == null || val.length === 0){
                return true;
            }else{
                return false;
            }
        }
    }
</script>

@/* js和业务用的js数组 */
<script type="text/javascript" src="${ctxPath}/assets/common/layui/layui.js"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js"></script>


<script src="${ctxPath}/assets/common/gallery/js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/gallery/js/ssg.js"></script>
<!--其他插件js-->
@if(isNotEmpty(plugins)){
@if(array.contain(plugins,"ztree")){
<script src="${ctxPath}/assets/common/plugins/jquery/jquery-3.2.1.min.js"></script>
<script src="${ctxPath}/assets/common/plugins/ztree/jquery.ztree.all.min.js"></script>
@}
@}

@if(isNotEmpty(js)){
@for(item in js){
@if(strutil.startWith(item,"/")){
@item = ctxPath + item;
@}
<script src="${item}"></script>
@}
@}
</body>
</html>